/*
 * ASTDom.h
 *
 *  Created on: 2010-5-28
 *      Author: Guobc
 */

#ifndef ASTDOM_H_
#define ASTDOM_H_

#include "ASTNodeList.h"
#include "ASTNode.h"
#include "Lexer.h"

namespace HA {
class ASTNode;
class Lexer;
class ASTDom {
public:

	/**
	 * Construct method.
	 */
	ASTDom() :
		mLexer(NULL) {

	}

	/**
	 * Open this document.
	 * @return True if success open, false otherwise.
	 */
	virtual bool open(const string& htmlName) = 0;

	/**
	 * Close this document.
	 */
	virtual void close() = 0;

	/**
	 * parse the content of this document.
	 */
	virtual void parse() throw (exception)= 0;

	//	/**
	//	 * Set the root AST node to ASTDom.
	//	 * @param root The root AST node.
	//	 */
	//	virtual void setRootNode(ASTNode* root) = 0;

	/**
	 * Get the root AST node to ASTDom.
	 * @param root The root AST node.
	 */
	virtual ASTNode* getRootNode() = 0;

protected:
	Lexer* mLexer;
};

}

#endif /* ASTDOM_H_ */
